home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / lldemo / lldemo.shr / ROSETTA.EXE / ROSETTA.DXR / 00177_diagnostic routines.ls < prev    next >
Encoding:
Text File  |  1996-06-24  |  21.8 KB  |  747 lines

  1. global gProcs, gGlobs
  2.  
  3. on makeTextList
  4.   repeat with i = 1 to the number of castMembers
  5.     if (the castType of cast i = #text) or (the castType of cast i = #button) then
  6.       put i && the textFont of cast i && the textHeight of cast i && the textSize of cast i && the textStyle of cast i
  7.     end if
  8.   end repeat
  9. end
  10.  
  11. on findCastInScore c
  12.   set str to "cast " & c & " used in: "
  13.   repeat with i = 1 to the lastFrame
  14.     go(i)
  15.     repeat with sP = 1 to 48
  16.       if the castNum of sprite sP = c then
  17.         put i & ", " after str
  18.       end if
  19.       if the scriptNum of sprite sP = c then
  20.         put i & ", " after str
  21.       end if
  22.     end repeat
  23.   end repeat
  24.   return str
  25. end
  26.  
  27. on getSpriteLocs
  28.   repeat with s = 1 to 29
  29.     set strH to "sprite " & s & " locH: "
  30.     set strV to "sprite " & s & " locV: "
  31.     repeat with i = 51 to 165
  32.       go(i)
  33.       if the castNum of sprite s <> 0 then
  34.         put the locH of sprite s & "," after strH
  35.         put the locV of sprite s & "," after strV
  36.       end if
  37.     end repeat
  38.     put strH
  39.     put strV
  40.   end repeat
  41.   return(str)
  42. end
  43.  
  44. on dumpText
  45.   set saveFile to FileIO(mnew, "?write", "outFile")
  46.   if objectp(saveFile) then
  47.     repeat with i = 1 to 1000
  48.       if the scriptText of cast i <> EMPTY then
  49.         set t to the scriptText of cast i
  50.         saveFile(mWriteString, RETURN & "$ " & i & RETURN)
  51.         saveFile(mWriteString, t)
  52.       end if
  53.     end repeat
  54.     saveFile(mdispose)
  55.   else
  56.     alert("Couldn't open file")
  57.   end if
  58. end
  59.  
  60. on getUsedScoreScripts
  61.   set ss to []
  62.   repeat with i = 1 to 200
  63.     go(i)
  64.     set s to the frameScript
  65.     if (s <> 0) and (getPos(ss, s) = 0) then
  66.       add(ss, s)
  67.     end if
  68.     repeat with j = 1 to 48
  69.       set s to the scriptNum of sprite j
  70.       if (s <> 0) and (getPos(ss, s) = 0) then
  71.         add(ss, s)
  72.       end if
  73.     end repeat
  74.   end repeat
  75.   sort(ss)
  76.   put ss
  77. end
  78.  
  79. on getAllScoreScripts
  80.   set ss to []
  81.   repeat with i = 1 to the number of castMembers
  82.     if the castType of cast i = #script then
  83.       add(ss, i)
  84.     end if
  85.   end repeat
  86.   put ss
  87. end
  88.  
  89. on closeProc proc, script, gList, pList, Locals
  90.   if proc <> EMPTY then
  91.     put "Proc: " & proc & " (" & script & ")"
  92.   else
  93.     put "Script: " & script
  94.   end if
  95.   if gList <> [] then
  96.     put "    Globals: " & printList(gList, 1)
  97.   end if
  98.   if pList <> [] then
  99.   end if
  100.   if Locals <> "," then
  101.     delete char 1 of Locals
  102.     delete char length(Locals) of Locals
  103.   end if
  104. end
  105.  
  106. on addList base, sP
  107.   set ret to existList(base, sP)
  108.   if ret = 0 then
  109.     add(base, [#s: sP, #count: 0, #glob: []])
  110.     set ret to count(base)
  111.   end if
  112.   return ret
  113. end
  114.  
  115. on existList base, sP
  116.   set c to count(base)
  117.   repeat with i = 1 to c
  118.     if getaProp(getAt(base, i), #s) = sP then
  119.       return i
  120.     end if
  121.   end repeat
  122.   return 0
  123. end
  124.  
  125. on tallyList base, sP
  126.   set i to existList(base, sP)
  127.   if i <> 0 then
  128.     set l to getAt(base, i)
  129.     setaProp(l, #count, getaProp(l, #count) + 1)
  130.     return 1
  131.   end if
  132.   return 0
  133. end
  134.  
  135. on tallyListScript base, sP, num
  136.   set i to existList(base, sP)
  137.   if i <> 0 then
  138.     set l to getAt(base, i)
  139.     setaProp(l, #count, getaProp(l, #count) + 1)
  140.     set numlis to getaProp(l, #scripts)
  141.     if voidp(numlis) then
  142.       set numlis to [num]
  143.     else
  144.       add(numlis, num)
  145.     end if
  146.     setaProp(l, #scripts, numlis)
  147.     return 1
  148.   end if
  149.   return 0
  150. end
  151.  
  152. on tallyListProc base, sP, pr
  153.   set i to existList(base, sP)
  154.   if i <> 0 then
  155.     set l to getAt(base, i)
  156.     set prlis to getaProp(l, #procs)
  157.     if voidp(prlis) then
  158.       set prlis to [pr]
  159.     else
  160.       if getOne(prlis, pr) = 0 then
  161.         add(prlis, pr)
  162.       end if
  163.     end if
  164.     setaProp(l, #procs, prlis)
  165.     return 1
  166.   end if
  167.   return 0
  168. end
  169.  
  170. on printList base, markUnused
  171.   set st to EMPTY
  172.   set c to count(base)
  173.   set prolog to EMPTY
  174.   repeat with i = 1 to c
  175.     set l to getAt(base, i)
  176.     if (markUnused = 1) and (getaProp(l, #count) = 0) then
  177.       set flag to "*"
  178.     else
  179.       set flag to " "
  180.     end if
  181.     put prolog & flag & getaProp(l, #s) after st
  182.     set prolog to ", "
  183.   end repeat
  184.   return st
  185. end
  186.  
  187. on makeGlobalList
  188.   set gGlobs to []
  189.   set gProcs to []
  190.   set xcount to 0
  191.   repeat with currcast = 1 to the number of castMembers
  192.     if the scriptText of cast currcast <> EMPTY then
  193.       set scrip to the scriptText of cast currcast
  194.       put "cast: " & currcast
  195.       set currProc to EMPTY
  196.       set numlines to the number of lines in scrip
  197.       repeat with ln = 1 to numlines
  198.         set s to line ln of scrip
  199.         if offset("--", s) <> 0 then
  200.           set s to char 1 to offset("--", s) - 1 of s
  201.         end if
  202.         set st to #xAny
  203.         set packet to getTok(s)
  204.         set s to getaProp(packet, #s)
  205.         set dest to getaProp(packet, #dest)
  206.         repeat while dest <> EMPTY
  207.           if st = #xAny then
  208.             if dest = "on" then
  209.               set st to #xProc
  210.             else
  211.               if dest = "global" then
  212.                 set st to #xGlobal
  213.               else
  214.                 if dest = "end" then
  215.                   set st to #xEnd
  216.                 else
  217.                   if dest = QUOTE then
  218.                     set st to #xQuote
  219.                   end if
  220.                 end if
  221.               end if
  222.             end if
  223.           else
  224.             if st = #xGlobal then
  225.               if dest <> "," then
  226.                 put "global: " & dest
  227.                 addList(gGlobs, dest)
  228.                 if currProc <> EMPTY then
  229.                   add(getaProp(getAt(gProcs, procnum), #glob), dest)
  230.                 end if
  231.               end if
  232.             else
  233.               if st = #xQuote then
  234.                 if dest = QUOTE then
  235.                   set st to #xAny
  236.                 end if
  237.               else
  238.                 if st = #xEnd then
  239.                   if (dest <> "if") and (dest <> "repeat") then
  240.                     set currProc to EMPTY
  241.                   end if
  242.                   set st to #xAny
  243.                 else
  244.                   if st = #xProc then
  245.                     put "proc: " & dest
  246.                     set procnum to addList(gProcs, dest)
  247.                     setaProp(getAt(gProcs, procnum), #cast, currcast)
  248.                     set currProc to dest
  249.                     set st to #xAny
  250.                   end if
  251.                 end if
  252.               end if
  253.             end if
  254.           end if
  255.           set packet to getTok(s)
  256.           set s to getaProp(packet, #s)
  257.           set dest to getaProp(packet, #dest)
  258.         end repeat
  259.       end repeat
  260.     end if
  261.   end repeat
  262.   put "finished global list"
  263. end
  264.  
  265. on analyzeCode
  266.   makeGlobalList()
  267.   makeTree()
  268. end
  269.  
  270. on makeTree
  271.   global gKeywords, gEnumList
  272.   put "Is the Global List Updated? - Call makeGlobalList first"
  273.   set currProc to EMPTY
  274.   set ggList to []
  275.   set gpList to []
  276.   set gEnumList to []
  277.   set ScriptGlob to []
  278.   set gKeywords to ",go,the,frame,if,clickOn,then,puppetSprite,FALSE,set,keydownscript,put,nothing,mouseH,and,mouseV,into,doubleClick,top,of,sprite,bottom,left,right,integer,number,lines,in,field,line,spriteBox,updateStage,castNum,to,cast,else,locH,fileio,mNew,objectp,mWriteString,RETURN,date,text,time,after,value,alert,mDispose,repeat,with,scriptText,empty,frameScript,getPos,add,sort,castmembers,casttype,script,TRUE,count,getaProp,getAt,setaProp,offset,char,while,QUOTE,chartonum,or,word,delete,halt,when,timeOut,textCast,locV,playFile,ticks,startTicks,soundBusy,stop,stillDown,lastClick,enabled,menuItem,menu,textFont,textStyle,random,foreColor,cursor,label,timeoutLength,exitLock,colorDepth,pathName,items,not,string,length,numtochar,mReadLine,key,dontPassEvent,rollOver,volume,TAB,fileObj,mReadFile,do,maxInteger,getNthFileNameInFolder,exit,append,immediate,mod,puppetTransition,keyDown,commandDown,chars,endTicks,picture,width,textSize,textAlign,voidP,mGet,mPut,puppetSound,mci,factory,machineType,"
  279.   set Locals to ","
  280.   set c to count(gProcs)
  281.   repeat with i = 1 to c
  282.     setaProp(getAt(gProcs, i), #count, 0)
  283.   end repeat
  284.   set c to count(gGlobs)
  285.   repeat with i = 1 to c
  286.     setaProp(getAt(gGlobs, i), #count, 0)
  287.   end repeat
  288.   repeat with currcast = 1 to the number of castMembers
  289.     if the scriptText of cast currcast <> EMPTY then
  290.       set scrip to the scriptText of cast currcast
  291.       set ScriptGlob to []
  292.       set numlines to the number of lines in scrip
  293.       repeat with ln = 1 to numlines
  294.         set s to line ln of scrip
  295.         if offset("--", s) <> 0 then
  296.           set s to char 1 to offset("--", s) - 1 of s
  297.         end if
  298.         set st to #xAny
  299.         set packet to getTok(s)
  300.         set s to getaProp(packet, #s)
  301.         set dest to getaProp(packet, #dest)
  302.         repeat while dest <> EMPTY
  303.           if st = #xAny then
  304.             if dest = "on" then
  305.               set st to #xProc
  306.             else
  307.               if dest = "global" then
  308.                 set st to #xGlobal
  309.               else
  310.                 if dest = QUOTE then
  311.                   set st to #xQuote
  312.                 else
  313.                   if dest = "end" then
  314.                     set st to #xEnd
  315.                   else
  316.                     if dest = "#" then
  317.                       set st to #xEnum
  318.                     else
  319.                       if isalpha(char 1 of dest) then
  320.                         if offset("," & dest & ",", gKeywords) = 0 then
  321.                           if offset("," & dest & ",", Locals) = 0 then
  322.                             if existList(gGlobs, dest) then
  323.                               if tallyList(ggList, dest) = 0 then
  324.                                 if tallyList(ScriptGlob, dest) = 0 then
  325.                                   put "*" & currProc & ": Global not declared: " & dest
  326.                                 end if
  327.                               end if
  328.                             else
  329.                               if existList(gProcs, dest) then
  330.                                 addList(gpList, dest)
  331.                                 tallyList(gProcs, dest)
  332.                               else
  333.                                 put dest & "," after Locals
  334.                               end if
  335.                             end if
  336.                           end if
  337.                         end if
  338.                       end if
  339.                     end if
  340.                   end if
  341.                 end if
  342.               end if
  343.             end if
  344.           else
  345.             if st = #xGlobal then
  346.               if (dest <> EMPTY) and (dest <> ",") then
  347.                 if currProc = EMPTY then
  348.                   addList(ScriptGlob, dest)
  349.                 else
  350.                   addList(ggList, dest)
  351.                 end if
  352.               end if
  353.             else
  354.               if st = #xQuote then
  355.                 if dest = QUOTE then
  356.                   set st to #xAny
  357.                 end if
  358.               else
  359.                 if st = #xEnum then
  360.                   if existList(gEnumList, dest) then
  361.                     tallyList(gEnumList, dest)
  362.                   else
  363.                     addList(gEnumList, dest)
  364.                   end if
  365.                   set st to #xAny
  366.                 else
  367.                   if st = #xEnd then
  368.                     if (dest <> "repeat") and (dest <> "if") and (dest <> currProc) then
  369.                       put "*" & currProc & ": check argument after 'end'"
  370.                     end if
  371.                     if dest = currProc then
  372.                       closeProc(currProc, currcast, ggList, gpList, Locals)
  373.                       set ggList to []
  374.                       set gpList to []
  375.                       set Locals to ","
  376.                       set currProc to EMPTY
  377.                     end if
  378.                     set st to #xAny
  379.                   else
  380.                     if st = #xProc then
  381.                       set currProc to dest
  382.                       set st to #xAny
  383.                     end if
  384.                   end if
  385.                 end if
  386.               end if
  387.             end if
  388.           end if
  389.           set packet to getTok(s)
  390.           set s to getaProp(packet, #s)
  391.           set dest to getaProp(packet, #dest)
  392.         end repeat
  393.         if st = #xEnd then
  394.           put "*'end' should have an argument"
  395.           if currProc <> EMPTY then
  396.             closeProc(currProc, currcast, ggList, gpList, Locals)
  397.             set ggList to []
  398.             set gpList to []
  399.             set Locals to ","
  400.           end if
  401.         end if
  402.       end repeat
  403.       if currProc <> EMPTY then
  404.         put "*" & currProc && "was not closed out"
  405.         closeProc(currProc, currcast, ggList, gpList, Locals)
  406.         set ggList to []
  407.         set gpList to []
  408.         set Locals to ","
  409.         set currProc to EMPTY
  410.       end if
  411.       if ScriptGlob <> [] then
  412.         put "Script Globals: " & printList(ScriptGlob, 1)
  413.       end if
  414.     end if
  415.   end repeat
  416.   put "Procedures not called:"
  417.   repeat with i = 1 to c
  418.     set cl to getAt(gProcs, i)
  419.     if getaProp(cl, #count) = 0 then
  420.       put "    " & getaProp(cl, #s)
  421.     end if
  422.   end repeat
  423. end
  424.  
  425. on isalpha c
  426.   set i to charToNum(c)
  427.   if ((i >= 65) and (i <= 90)) or ((i >= 97) and (i <= 122)) then
  428.     return 1
  429.   else
  430.     return 0
  431.   end if
  432. end
  433.  
  434. on isdigit c
  435.   set i to charToNum(c)
  436.   if (i >= 48) and (i <= 57) then
  437.     return 1
  438.   else
  439.     return 0
  440.   end if
  441. end
  442.  
  443. on isprint c
  444.   set i to charToNum(c)
  445.   if i >= 33 then
  446.     return 1
  447.   else
  448.     return 0
  449.   end if
  450. end
  451.  
  452. on isalnum c
  453.   if isalpha(c) or isdigit(c) then
  454.     return 1
  455.   else
  456.     return 0
  457.   end if
  458. end
  459.  
  460. on getTok sP
  461.   set w to word 1 of sP
  462.   set ch to char 1 of w
  463.   if w = EMPTY then
  464.     set sP to EMPTY
  465.     set done to 1
  466.   else
  467.     if isdigit(ch) then
  468.       set state to #tsNum
  469.     else
  470.       if isalpha(ch) then
  471.         set state to #tsToken
  472.       else
  473.         if isprint(ch) then
  474.           set state to #tsSymbol
  475.         else
  476.           put "Huh? (" & charToNum(ch) & ") " & sP
  477.           set sP to EMPTY
  478.           set done to 1
  479.         end if
  480.       end if
  481.     end if
  482.   end if
  483.   set howmany to 0
  484.   repeat while done = 0
  485.     set howmany to howmany + 1
  486.     set ch to char howmany of w
  487.     if state = #tsNum then
  488.       if isdigit(ch) = 0 then
  489.         set done to 1
  490.         set howmany to howmany - 1
  491.       end if
  492.       next repeat
  493.     end if
  494.     if state = #tsToken then
  495.       if isalnum(ch) = 0 then
  496.         set done to 1
  497.         set howmany to howmany - 1
  498.       end if
  499.       next repeat
  500.     end if
  501.     if state = #tsSymbol then
  502.       set done to 1
  503.     end if
  504.   end repeat
  505.   set dP to char 1 to howmany of w
  506.   set white to offset(dP, sP) - 1
  507.   delete char 1 to howmany + white of sP
  508.   return [#s: sP, #dest: dP]
  509. end
  510.  
  511. on tree pr
  512.   printRoutine(pr, 1)
  513. end
  514.  
  515. on printRoutine pr, level
  516.   set procnum to existList(gProcs, pr)
  517.   if procnum = 0 then
  518.     put "Couldn't find proc: " & pr
  519.     halt()
  520.   end if
  521.   set space to EMPTY
  522.   repeat with i = 1 to level
  523.     put "  " after space
  524.   end repeat
  525.   put space & pr & " (" & formatList(getaProp(getAt(gProcs, procnum), #glob)) & ") [" & getaProp(getAt(gProcs, procnum), #cast) & "]"
  526.   set scrip to the scriptText of cast getaProp(getAt(gProcs, procnum), #cast)
  527.   set numlines to the number of lines in scrip
  528.   set st to #xBefore
  529.   repeat with ln = 1 to numlines
  530.     set s to line ln of scrip
  531.     if offset("--", s) <> 0 then
  532.       set s to char 1 to offset("--", s) - 1 of s
  533.     end if
  534.     set packet to getTok(s)
  535.     set s to getaProp(packet, #s)
  536.     set dest to getaProp(packet, #dest)
  537.     repeat while dest <> EMPTY
  538.       if st = #xBefore then
  539.         if dest = "on" then
  540.           set st to #xBefore1
  541.         end if
  542.       else
  543.         if st = #xBefore1 then
  544.           if dest = pr then
  545.             set st to #xAny
  546.           else
  547.             set st to #xBefore
  548.           end if
  549.         else
  550.           if st = #xAny then
  551.             if dest = QUOTE then
  552.               set st to #xQuote
  553.             else
  554.               if dest = "end" then
  555.                 set st to #xEnd
  556.               else
  557.                 if isalpha(char 1 of dest) then
  558.                   set isProc to existList(gProcs, dest)
  559.                   if isProc then
  560.                     printRoutine(dest, level + 1)
  561.                   end if
  562.                 end if
  563.               end if
  564.             end if
  565.           else
  566.             if st = #xQuote then
  567.               if dest = QUOTE then
  568.                 set st to #xAny
  569.               end if
  570.             else
  571.               if st = #xEnd then
  572.                 if (dest = "repeat") or (dest = "if") then
  573.                   set st to #xAny
  574.                 else
  575.                   if dest = pr then
  576.                     set st to #xAfter
  577.                   else
  578.                     put pr & ": check argument after 'end'"
  579.                     set st to #xAfter
  580.                   end if
  581.                 end if
  582.               end if
  583.             end if
  584.           end if
  585.         end if
  586.       end if
  587.       if st = #xAfter then
  588.         return 
  589.       end if
  590.       set packet to getTok(s)
  591.       set s to getaProp(packet, #s)
  592.       set dest to getaProp(packet, #dest)
  593.     end repeat
  594.   end repeat
  595. end
  596.  
  597. on formatList lis
  598.   set st to EMPTY
  599.   set c to count(lis)
  600.   repeat with i = 1 to c
  601.     if i <> 1 then
  602.       put ", " after st
  603.     end if
  604.     put getAt(lis, i) after st
  605.   end repeat
  606.   return st
  607. end
  608.  
  609. on countGlobals
  610.   global gKeywords, gEnumList
  611.   put "Is the Global List Updated? - Call makeGlobalList first"
  612.   set currProc to EMPTY
  613.   set ggList to []
  614.   set gpList to []
  615.   set gEnumList to []
  616.   set ScriptGlob to []
  617.   set Locals to ","
  618.   set c to count(gProcs)
  619.   set gKeywords to ",go,the,frame,if,clickOn,then,puppetSprite,FALSE,set,keydownscript,put,nothing,mouseH,and,mouseV,into,doubleClick,top,of,sprite,bottom,left,right,integer,number,lines,in,field,line,spriteBox,updateStage,castNum,to,cast,else,locH,fileio,mNew,objectp,mWriteString,RETURN,date,text,time,after,value,alert,mDispose,repeat,with,scriptText,empty,frameScript,getPos,add,sort,castmembers,casttype,script,TRUE,count,getaProp,getAt,setaProp,offset,char,while,QUOTE,chartonum,or,word,delete,halt,when,timeOut,textCast,locV,playFile,ticks,startTicks,soundBusy,stop,stillDown,lastClick,enabled,menuItem,menu,textFont,textStyle,random,foreColor,cursor,label,timeoutLength,exitLock,colorDepth,pathName,items,not,string,length,numtochar,mReadLine,key,dontPassEvent,rollOver,volume,TAB,fileObj,mReadFile,do,maxInteger,getNthFileNameInFolder,exit,append,immediate,mod,puppetTransition,keyDown,commandDown,chars,endTicks,picture,width,textSize,textAlign,voidP,mGet,mPut,puppetSound,mci,factory,machineType,"
  620.   repeat with i = 1 to c
  621.     setaProp(getAt(gProcs, i), #count, 0)
  622.   end repeat
  623.   set c to count(gGlobs)
  624.   repeat with i = 1 to c
  625.     setaProp(getAt(gGlobs, i), #count, 0)
  626.   end repeat
  627.   repeat with currcast = 1 to the number of castMembers
  628.     if the scriptText of cast currcast <> EMPTY then
  629.       set scrip to the scriptText of cast currcast
  630.       put "cast: " & currcast
  631.       set ScriptGlob to []
  632.       set numlines to the number of lines in scrip
  633.       repeat with ln = 1 to numlines
  634.         set s to line ln of scrip
  635.         if offset("--", s) <> 0 then
  636.           set s to char 1 to offset("--", s) - 1 of s
  637.         end if
  638.         set st to #xAny
  639.         set packet to getTok(s)
  640.         set s to getaProp(packet, #s)
  641.         set dest to getaProp(packet, #dest)
  642.         repeat while dest <> EMPTY
  643.           if st = #xAny then
  644.             if dest = "on" then
  645.               set st to #xProc
  646.             else
  647.               if dest = "global" then
  648.                 set st to #xGlobal
  649.               else
  650.                 if dest = QUOTE then
  651.                   set st to #xQuote
  652.                 else
  653.                   if isalpha(char 1 of dest) then
  654.                     if offset("," & dest & ",", gKeywords) = 0 then
  655.                       if existList(gGlobs, dest) then
  656.                         tallyListProc(gGlobs, dest, currProc && currcast)
  657.                       end if
  658.                     end if
  659.                   end if
  660.                 end if
  661.               end if
  662.             end if
  663.           else
  664.             if st = #xGlobal then
  665.               if (dest <> EMPTY) and (dest <> ",") then
  666.                 if currProc = EMPTY then
  667.                   addList(ScriptGlob, dest)
  668.                 else
  669.                   addList(ggList, dest)
  670.                 end if
  671.               end if
  672.             else
  673.               if st = #xQuote then
  674.                 if dest = QUOTE then
  675.                   set st to #xAny
  676.                 end if
  677.               else
  678.                 if st = #xEnum then
  679.                   if existList(gEnumList, dest) then
  680.                     tallyList(gEnumList, dest)
  681.                   else
  682.                     addList(gEnumList, dest)
  683.                   end if
  684.                   set st to #xAny
  685.                 else
  686.                   if st = #xEnd then
  687.                     if (dest <> "repeat") and (dest <> "if") and (dest <> currProc) then
  688.                     end if
  689.                     if dest = currProc then
  690.                       closeProc(currProc, currcast, ggList, gpList, Locals)
  691.                       set ggList to []
  692.                       set gpList to []
  693.                       set Locals to ","
  694.                       set currProc to EMPTY
  695.                     end if
  696.                     set st to #xAny
  697.                   else
  698.                     if st = #xProc then
  699.                       set currProc to dest
  700.                       set st to #xAny
  701.                     end if
  702.                   end if
  703.                 end if
  704.               end if
  705.             end if
  706.           end if
  707.           set packet to getTok(s)
  708.           set s to getaProp(packet, #s)
  709.           set dest to getaProp(packet, #dest)
  710.         end repeat
  711.         if st = #xEnd then
  712.           if currProc <> EMPTY then
  713.             closeProc(currProc, currcast, ggList, gpList, Locals)
  714.             set ggList to []
  715.             set gpList to []
  716.             set Locals to ","
  717.           end if
  718.         end if
  719.       end repeat
  720.       if currProc <> EMPTY then
  721.         closeProc(currProc, currcast, ggList, gpList, Locals)
  722.         set ggList to []
  723.         set gpList to []
  724.         set Locals to ","
  725.         set currProc to EMPTY
  726.       end if
  727.       if ScriptGlob <> [] then
  728.       end if
  729.     end if
  730.   end repeat
  731. end
  732.  
  733. on printGlobalList
  734.   global gGlobs
  735.   set lis to []
  736.   set n to count(gGlobs)
  737.   repeat with i = 1 to n
  738.     set s to getaProp(getAt(gGlobs, i), #s)
  739.     put ": " after s
  740.     set scr to getaProp(getAt(gGlobs, i), #procs)
  741.     put string(scr) after s
  742.     add(lis, s)
  743.   end repeat
  744.   sort(lis)
  745.   put string(lis)
  746. end
  747.